clear

global b;
global I;
global Kd;
KArr = [0.19, 0.39, 1.09];
%K = KArr(1);
b = 0.02;
I = 0.004;

diez = 0;
cinco = 0;
uno = 0;
cero = 0;

colors = {'r^', 'r+', 'r*'};%, 'ro'};% 'rx', 'ro'};% , 'bs', 'b^'};
labels = {'k=0.19','k=0.39','k=1.09'};%,'k=0.05'};%,'k=0.07','k=0.08'};%,'k=10^-1','k=1', 'thetaR'};%,'k=15','k=20', 'Tout(t)'};

for i=1:length(KArr)
    Kd=KArr(i);
    [T Z]=rk4sgral(0,1000,[0,0],100000,'thetapuntoe');
    erp=ERP(Z(:,1),T);
    p(i)=plot(T(1:20:length(T)),erp(1:20:length(T)), colors{i});
    hold on;
end

ind=(1:length(labels));
legend(p(ind), labels{ind}, 'Location', 'NorthEastOutside');

time = T(1:100:length(T));

errors = [0.1, 0.05, 0.01, 0.001];

for i=1:length(errors)
   Y=ones(length(time))*errors(i);

   plot(time, Y, 'b-');
end
xlabel('Tiempo[s]');
ylabel('ERP');

hold off;
axis([0 100 -1.5 1.5])

%res(:,1), thetaR(res(:,1)), 'b-');
